package lesson06;

public class OuterClass {

    private class InnerClass{
        public void innerShow(){
            System.out.println("InnerClass的方法innerShow");
        }
    }
    private static class StaticInnerClass{
        public void innerShow(){
            System.out.println("StaticInnerClass的方法innerShow");
        }
    }
    public void outerShow(){
        System.out.println("OuterClass的方法outerShow");
        InnerClass innerClass = new InnerClass();
        innerClass.innerShow();
        StaticInnerClass staticInnerClass = new StaticInnerClass();
        staticInnerClass.innerShow();

        class LocalInnerClass{
            public void innerShow(){
                System.out.println("LocalInnerClass的方法innerShow");
            }
        }

        LocalInnerClass localInnerClass = new LocalInnerClass();
        localInnerClass.innerShow();

        OuterClass outerClass = new OuterClass(){
            public void outerShow(){
                System.out.println("匿名内部类的方法innerShow");
            }
        };
        outerClass.outerShow();
    }


    public static void main(String[] args) {
        OuterClass outerClass = new OuterClass();
        outerClass.outerShow();
    }

}
